<template>
  <div class="like-page">
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <articleIitem v-for="(item,index) in list" :key="index" :item="item"></articleIitem>
    </van-list>
  </div>
</template>

<script>
import { getLike } from '@/api/collect.js'
export default {
  name: 'LikePage',
  async created () {
    const res = await getLike()
    this.list = res.data.rows
  },
  data () {
    return {
      list: [],
      page: 1,
      loading: false,
      finished: false
    }
  },
  methods: {
    async onLoad () {
      const res = await getLike(this.page)
      this.list.push(...res.data.rows)
      this.loading = false
      this.page++
      if (this.list.length < 10 || res.data.Total < this.page) this.finished = true
    }
  }
}
</script>

<style lang="less" scoped>

</style>
